<template>
  <view class="page">
    <!-- 标题栏 start -->
    <fu-custom :isBack="true" bgColor="bg-white" class="header" :isBottom="true">
      <block slot="content">{{ i18n['注销账号'] }}</block>
      <block slot="right">
      </block>
    </fu-custom>
    <view class=" padding-lr">
      <view>
        <view class="img">
          <image v-if='isSuccess' :src="imgWechatUrl+'/index/success.png'"></image>
          <image v-else :src="imgWechatUrl+'/index/fail.png'"></image>
        </view>
        <view class="center">
          {{title}}
        </view>
      </view>
      <view class="bg-white padding margin info" v-if='!isSuccess'>
       <view>因您的账户近15天内有过订单交易记录，为充分保障您及交易相对方的交易安全及信息完整性，请您在交易结束(交易成功/交易关闭) 15天后再次申请。</view>  
       <view>异常订单号：{{list.join(',')}}</view>
      </view>
      <view class="bg-white padding margin info" v-if='isSuccess'>
        <!-- 你的账户已被注销，账户中的余额、积分、订单均已被清空，但是你仍可以重新注册 -->
		您已成功申请账号注销，平台会在2-3个工作日之内处理完成，感谢您的使用，请您耐心等待！
      </view>
      <view class="login-btn" @click="handleNext">
        {{ i18n['确认'] }}
      </view>
    </view>
    <!-- 断网监测 start -->
    <fu-notwork></fu-notwork>
    <!-- 断网监测 end -->
  </view>
</template>

<script>
  export default {
    data() {
      return {
				imgWechatUrl: this.imgWechatUrl,
        isSuccess:false,
        title:'账号注销失败',
        list:[],
      }
    },
    onLoad(option) {
      this.isSuccess = option.isSuccess==1 ?true:false
      console.log( this.isSuccess)
      if(this.isSuccess){
        this.title = '账号注销申请成功'
      }else{
        let list  = this.$store.state.cancelAccount
        list.forEach(item=>{
          this.list.push(item.order_sn)
        })
        console.log(this.list,this.$store.state)
      }
    },
    methods: {
      handleNext() {
        if (!this.isSuccess) {
          uni.navigateBack({
            delta: 3
          });
        }else{
          this.$urouter.switchTab('/pages/tab/my/my/index');
        }

      }
    },
  }
</script>

<style lang="scss" scoped>
  page {
    height: 100%;
    /* background: #ffffff; */
  }

  .content {
    min-height: 800rpx;
  }

  .agreement {
    display: flex;
    width: 100%;
    font-family: PingFangSC-Regular;
    font-size: 28rpx;
    color: #666666;
    align-items: center;
    justify-content: center;
    margin-bottom: 30rpx;

    .image {
      height: 28rpx;
      width: 28rpx;
      margin-right: 12rpx;
    }

    text {
      color: #FFA133;
    }
  }

  .login-btn {
    height: 88rpx;
    line-height: 88rpx;
    background: $bgtheme;
    opacity: 1;
    border-radius: 44px;
    margin: 0 56rpx;
    font-size: 32rpx;
    color: #FFFFFF;
    font-family: PingFang SC;
    font-weight: 500;
    text-align: center;
  }

  .info {
    border-radius: 16rpx;
  }

  .center {
    text-align: center;
    margin: 30rpx 0 30rpx;
    font-size: 32rpx;
  }

  .img {
    margin: 20rpx auto;
    width: 88rpx;
    height: 88rpx;

    image {
      width: 100%;
      height: 100%;
    }
  }
</style>